﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace DAO
{
    public class QuyDinhDAO : AbstractDAO<QuyDinhDTO>
    {
        protected override string GetTableName()
        {
            return "quydinh";
        }

        public string GetByName(string tenquydinh)
        {
            String query = String.Format("SELECT * FROM {0} WHERE tenquydinh = '{1}'", tableName, tenquydinh);
            DataTable dt = dataProvider.ExecuteQuery(query);
            if (dt.Rows.Count > 0)
            {
                return dt.Rows[0]["giatri"].ToString();
            }
            return "";
        }


        public override QuyDinhDTO GetByDataRow(DataRow data)
        {
            throw new NotImplementedException();
        }
    }
}
